﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace nodeApp
{
     public class Node
    {
        int xCoordinate;
        int yCoordinate;
        string concatnate;
        public bool visited
        {
            get;
            set;
        }
        public int nodeNumber
        {
            get;
            set;
        }

        public Node(int x, int y, int number)
        {
            xCoordinate = x;
            yCoordinate = y;
            nodeNumber = number;
            concatnate = this.makeKey();
        }

        public string makeKey()
        {
            string xCord = xCoordinate.ToString();
            string yCord = yCoordinate.ToString();
            string finalKey = "";
           
            if (xCoordinate.ToString().Length < 3)
            {
                for (int i = 3 - xCoordinate.ToString().Length; i > 0; i--)
                {
                    xCord = "0" + xCord;
                }
            }

            if (yCoordinate.ToString().Length < 3)
            {
                for (int i = 3 - yCoordinate.ToString().Length; i > 0; i--)
                {
                    yCord = "0" + yCord;
                }
            }

            finalKey = xCord + yCord;
            concatnate = finalKey;
            return finalKey;
        }
    }
}
